﻿/*
 * Created by: Robert (Bob) Williams
 * Date: 9/18/2012
 * Time: 11:15:00 AM
 * 
 * Deploy File Generator
 * 
 */
// -----------------------------------------------------------------------

// <copyright file="Program.cs" >
// Created by Robert (Bob) Williams, 2012
// </copyright>
//
// CHANGELOG
/*    Copyright 2012 Robert Williams
    
This file is part of DeployFileGenerator.

DeployFileGenerator is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

DeployFileGenerator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with DeployFileGenerator.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
 * Run this program to build a .resx file and an .xml file from files in the specified folder.
 * Manually add the .resx file back into this program, then build.
 * (if necessary change properties - build action to 'Embedded Resource' and Custom tool to 'ResXFileCodeGenerator' - so it will compile. )
 * The Output file will show something like: "Processing resource file "DeployFile.resx" into "obj\x86\Release\DeployFileGenerator.DeployFile.resources" ".
 * 
 * Manually add the .resources file into your main Visual Studio Solution.
 * Manually add the .xml file into your main Visual Studio Solution's 'Resources' folder.
 * 
 * In your main Visual Studio Solution, load 'LibDeployFiles.cs'.
 * Set up your code to call 'DeployResources' and supply the destination path for the files and 'ProjectName.ResourceFileName' (ex. MyProject.DeployFileGenerator.DeployFile.resources)
 * This should deploy the files to the destination.
 */


using System;
using BW.AppInstaller;

namespace DeployFileGenerator
{
    static class Program
    {
        private static ApplicationInstaller installerLib = new ApplicationInstaller();

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            String sourceFileDirectory = @"C:\temp\DeploySourceFiles";
            String resxFile = @"C:\temp\ProjectFiles\DeployFile.resx";
            String xmlFile =  @"C:\temp\ProjectFiles\PackageFiles.xml";
            installerLib.CreateResXFile(sourceFileDirectory, resxFile, xmlFile);

            GC.Collect();
            Environment.Exit(0);
        }
    }
}
